﻿namespace ElencySolutions.ImageMap.Properties
{
    using System;
    using EPiServer.Core.PropertySettings;
    using EPiServer.Data.Dynamic;

    /// <summary>
    /// Property filtered page reference settings class
    /// </summary>
    [PropertySettingsUI(AdminControl = typeof(ImageMapPropertySettingsUI))]
    [EPiServerDataContract]
    public class ImageMapPropertySettings : IPropertySettings
    {

        [EPiServerDataMember]
        public int? PopupWidth { get; set; }

        [EPiServerDataMember]
        public int? PopupHeight { get; set; }

        public ImageMapPropertySettings()
        {
            PopupHeight = ImageMapPropertyControl.DEFAULT_POPUP_HEIGHT;
            PopupWidth = ImageMapPropertyControl.DEFAULT_POPUP_WIDTH;
        }

        #region IPropertySettings Members

        /// <summary>
        /// Copies this instance.
        /// </summary>
        /// <returns>IPropertySettings instance</returns>
        IPropertySettings IPropertySettings.Copy()
        {
            ImageMapPropertySettings settings = new ImageMapPropertySettings();
            settings.PopupHeight = PopupHeight;
            settings.PopupWidth = PopupWidth;
            return settings;
        }

        /// <summary>
        /// Gets the default values.
        /// </summary>
        /// <returns>IPropertySettings instance</returns>
        IPropertySettings IPropertySettings.GetDefaultValues()
        {
            return new ImageMapPropertySettings();
        }

        /// <summary>
        /// Gets or sets the id.
        /// </summary>
        /// <value>
        /// The id.
        /// </value>
        Guid IPropertySettings.Id
        {
            get { throw new NotImplementedException(); }
            set { throw new NotImplementedException(); }
        }

        #endregion
    }

}